#include "StdAfx.h"
#include "BieuThucDon.h"
#include <math.h>

BieuThucDon::BieuThucDon()
{
	HeSo = 0;
	SoMu = 0;
	GiaTriBien = 0;
}


BieuThucDon::BieuThucDon(int Heso, int Somu,int giatribien)
{
	HeSo = Heso;
	SoMu = Somu;
	GiaTriBien = giatribien;
}

double BieuThucDon::TinhGiaTri()
{
	double KQ;
	KQ = HeSo * (pow(GiaTriBien,SoMu));
	return KQ;
}

BieuThuc BieuThucDon::TinhDaoHam()
{
	BieuThucDon BT;
	BT.HeSo = HeSo * SoMu;
	BT.SoMu = SoMu - 1;
	printf("%eX\^%e \= %e",HeSo,SoMu,TinhGiaTri());
	return BT;
}
